package com.codesynapse.controller;

import com.codesynapse.service.AIModelService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/sql")
@RequiredArgsConstructor
public class SQLGenerationController {

    private final AIModelService aiModelService;

    @PostMapping("/generate")
    public String generateSQL(@RequestBody String naturalLanguage) {
        return aiModelService.generateSQL(naturalLanguage);
    }
} 